
mob/proc/UpdateMovementSpeed() // this prochandles movement speed, the speed is based on basespd(the ammount of ticks to move) but then divide with spddiv, speed divider.


	if (canwalk == 0 )
		spddiv = 1
	if (canwalk == 1)
		spddiv = 2
	if (running)
		spddiv = 4
	if (SPDDB)
		world << "[basespd / spddiv]" // i have an enviromental constant that i can tick on wich shows the time in ticks it should take to move. For debugging purposes.

client/Move()


	//spawn(mob.basespd / mob.spddiv)
	if (didmovecall) // make sure the proc is only called once per "turn".
		return
	else
		if(mob.cancrawl == 1 || mob.canwalk == 1) // if the mob is in a state where he can walk, or atleast crawl(wich doubles movementspeed)
			didmovecall = 1	// triggering the safeguard, blocking all other calls of the proc untill
			mob.UpdateMovementSpeed() // Calls the proc that manages the speed of the character
			sleep(mob.basespd / mob.spddiv) // the movement delay

			didmovecall = 0 // reset safeguard
			..() // call the rest of the proc

			view(2) << "[mob.name] walks [mob.getdireshun()]"

client/var/didmovecall = 0

mob/proc/getdireshun()
	if(dir == 1)
		return "NORTH"
	if(dir == 2)
		return "SOUTH"
	if(dir == 4)
		return "EAST"
	if(dir == 8)
		return "WEST"

mob/Bump()
	view(2) << "[usr] couldnt walk [getdireshun()]"
	..()
/*
client/North()
	mob.dir = "NORTH"
	..()

client/South()
	mob.dir = "SOUTH"
	..()

client/West()
	mob.dir = "WEST"
	..()

client/East()
	mob.dir = "EAST"
	..()*/



